package cn.codeforfun.common;

import cn.codeforfun.jfinalplugin.quartz.core.QuartzPlugin;
import cn.codeforfun.job.Job1;
import cn.codeforfun.job.Job2;
import com.jfinal.config.*;

public class Config extends JFinalConfig {
    public void configConstant(Constants me) {

    }

    public void configRoute(Routes me) {

    }

    public void configPlugin(Plugins me) {
        QuartzPlugin quartzPlugin = new QuartzPlugin();
        quartzPlugin.addJob(new Job1().cron("0/2 * * * * ? *"));// 每两秒跑一次job
        quartzPlugin.addJob(new Job2().cron("0/5 * * * * ? *"));// 每五秒跑一次job

        me.add(quartzPlugin);
    }

    public void configInterceptor(Interceptors me) {

    }

    public void configHandler(Handlers me) {

    }
}
